import axios from "axios";

axios.defaults.baseURL = "http://127.0.0.1:8999/"

export async function listForm() {
  return await axios.get("/list_form")
}

export async function postFormApi(obj) {
  console.log(obj)
  return await axios.post("/insert_form", obj)
}

export async function tables() {

  return await axios.get("/tables")
}

export async function getCollection(_coll_name) {
  let url = "/collection/" + _coll_name
  return await axios.get(url)
}

export async function insertDataToColl(_coll_name, _insert_obj) {
  let url = "/collection/" + _coll_name;
  return await axios.post(url, _insert_obj)
}